#coding=utf-8

'''
@author: tongji(tongji@rekoo.com)
'''

def init_data():
    '''初始化参数数据格式，具体哪个键记什么东西，由后端程序员确定'''
    return {'v1':None, 'v2':None, 'v3':None, 'v4':None, 'num':None}

# --------------------------------下面是要写的回调函数，协议：callback(request, args)
# args是视图执行前后的金币，酷币，经验，等级的状态 
# args = {'before':{'gold':100, ...}, 'after':{'gold':20, ...}}
# 请在返回的字典中设置一个'success'位， 默认为True

def get_test_value(request, args):
    '''测试'''
    data = init_data()
    if args['before']['first_name'] == args['after']['first_name']:
        data['success'] = False
    else:
        data['v1'] = 100
        data['v2'] = 3000
        data['v3'] = 105
    return data


# 统计白名单，只有加入到这个名单的视图函数才会被记录{全局名字：对应回调函数}


whitelist = {
            'main.views.test'     :   get_test_value,
            'main.views.start'    :   None,
            'main.views2.mytest'  :   None,
            }

